package com.ling.netty.demo13.server;


import com.ling.netty.demo13.codec.ObjDecoder;
import com.ling.netty.demo13.codec.ObjEncoder;
import com.ling.netty.demo13.domain.MsgInfo;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @author ling007
 * @date 2024/8/7 14:46
 * @desciption:
 */
public class MyChannelInitializer13 extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel channel) {
        //对象传输处理
        channel.pipeline().addLast(new ObjDecoder(MsgInfo.class));
        channel.pipeline().addLast(new ObjEncoder(MsgInfo.class));
        // 在管道中添加我们自己的接收数据实现方法
        channel.pipeline().addLast(new MyServerHandler13());
    }
}
